package com.vehicle.feign;


import com.vehicle.feignForm.CollegeForm;
import com.vehicle.feignForm.ContactForm;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@FeignClient("contact-service")//模块名称
public interface ContactFeign {

    @GetMapping("/college-detail/getDetail/{cdId}")
    public String getDetailById(@PathVariable("cdId") Integer cdId);

    @GetMapping("/college-detail/collegeId/{cdId}")
    public Integer getCollageIdById(@PathVariable("cdId") Integer cdId);

    @GetMapping("/college/getUniverId/{collegeId}")
    public Integer getUniverIdById(@PathVariable("collegeId") Integer collegeId);

    @GetMapping("/university/getName/{univerId}")
    public String getNameUniversity(@PathVariable("univerId") Integer univerId);

    //添加学院
    @PostMapping("/college")
    public boolean addCollege(@RequestBody CollegeForm collegeForm);

    //获取学院信息
    @GetMapping("/college/getCollegeName/{collegeId}")
    public String getCollageNameById(@PathVariable("collegeId") Integer collegeId);

    //修改学院信息
    @PutMapping("/college")
    public Boolean updateCollage(@ModelAttribute CollegeForm collegeForm);

    //删除学院信息
    @DeleteMapping("/college/{collegeId}")
    public Boolean deleteCollege(@PathVariable("collegeId") Integer collegeId);


    //添加联系人
    @PostMapping("/contact")
    public Integer addContact(@RequestBody ContactForm contactForm);

    //获取联系人
    @GetMapping("/contact/getMessage/{contactId}")
    public ContactForm getContactMessage(@PathVariable("contactId") Integer contactId);

    //修改联系人
    @PutMapping("/contact")
    public Boolean updateContact(@ModelAttribute ContactForm contactForm);

    //删除联系人
    @DeleteMapping("/contact/{contactId}")
    public Boolean deleteContact(@PathVariable("contactId") Integer contactId);
}
